<?php
/* -------------------------------------
*  
*  GDOLG.RU - site about national debt
*  
*  @copyright: Marsel Hasanshin 2012
*  
*  @author: Anton Minacov
*  @email: maggotjb@gmail.com
*  
*  this file should be load first
*  
* --------------------------------------
*/

define("MAIN_DIR",dirname(__FILE__).DIRECTORY_SEPARATOR);
require_once MAIN_DIR.DIRECTORY_SEPARATOR."core".DIRECTORY_SEPARATOR."defines.php";
require_once CORE."settings.php";
require_once CORE."functions.php";
require_once CORE."classes.php";

session_start();

$route = new Router();
$db = new MySQL(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
$user = new User();

switch ($route->getPath()) {
	
	case "":		require_once MAIN.MAINFILE; break;
	case "admin":	echo "load ".ADMIN.MAINFILE; require_once ADMIN.MAINFILE; die; break;
	
	default:		require_once APP."404.php";
}

?>